package it.polito.connectedcar.general.network;

import java.net.InetSocketAddress;
import java.net.SocketException;

/**
 * This class represents a Factory providing sockets for a simulation
 * environment. See {@link SimulatedDatagramSocket} for more details on the
 * simulated socket
 * 
 * @author Nicola Aresta
 * 
 */
public class SimulatedNetworkConnectorFactory implements NetworkConnectorFactory {

	public SimulatedNetworkConnectorFactory() {
	}

	@Override
	public synchronized ConnectedCarSocket getSocket() throws SocketException {
		return new SimulatedDatagramSocket(new InetSocketAddress("127.0.0.1", 0));
	}
}
